/*
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/

Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
*/
package com.jorritdevries.console
{

	/**
	 * ConsoleItem is a by Console internally used class to store information
	 * about a variable or Function to be addressed.
	 * @author jorrit@jorritdevries.com
	 */
	internal class ConsoleItem
	{
		private var mName:String;
		private var mDescription:String;
		private var mType:uint;
		private var mAny:*;
		private var mVarName:String;
		
		/**
		 * Creates a new ConsoleItem.
		 * @param name
		 * @param description
		 * @param type
		 * @param ...rest
		 */
		public function ConsoleItem(name:String, description:String, type:uint, ...rest)
		{
			mName = name;
			mDescription = description;
			mType = type;
			// We do not check these, since it is assumed to be done by the Console class
			if (mType == ConsoleItemType.FUNCTION)
			{
				mAny = rest[0];
			}
			else
			{
				mAny = rest[0];
				mVarName = String(rest[1]);
			}
		}
		
		/**
		 * 
		 */
		internal function get name():String
		{
			return mName;
		}
		
		/**
		 * 
		 */
		internal function get description():String
		{
			return mDescription;
		}
		
		/**
		 * 
		 */
		internal function get type():uint
		{
			return mType;
		}
		
		/**
		 * 
		 */
		internal function get any():*
		{
			return mAny;
		}
		
		/**
		 * 
		 */
		internal function get varName():String
		{
			return mVarName;
		}
	}
	
}